Skip to content

fix(text area): fix cursor display on wrapped line#6196

Merged
willmcgugan merged 3 commits into
Textualize:mainfrom
TomJGooding:fix-text-area-fix-cursor-on-wrapped-line
Nov 3, 2025
Merged

fix(text area): fix cursor display on wrapped line#6196
willmcgugan merged 3 commits into
Textualize:mainfrom
TomJGooding:fix-text-area-fix-cursor-on-wrapped-line

Conversation

@TomJGooding

@TomJGooding TomJGooding commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Currently the TextArea cursor display is broken when trying to navigate a wrapped line:

  • Clicking a wrapped line will cause the cursor to disappear
  • Keyboard navigation on a wrapped line won't blink the cursor

The problem is that the line cache introduced in ec0c050 doesn't properly account for wrapped lines.

Fix the cache key so the 'cursor location' element is not simply based on a location in document-space.

Fixes #6195

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

Currently the `TextArea` cursor display is broken when trying to
navigate a wrapped line:

- Clicking a wrapped line will cause the cursor to disappear
- Keyboard navigation on a wrapped line won't blink the cursor

The problem is that the line cache introduced in ec0c050 doesn't
properly account for wrapped lines.

Fix the cache key so the 'cursor location' element is not simply based
on a location in document-space.

Fixes #6195
@TomJGooding

Copy link
Copy Markdown
Contributor Author

Since these issues depend on the cursor blink, I'm not sure it's possible to add any regression test for this?

@TomJGooding TomJGooding marked this pull request as ready for review October 30, 2025 16:22
@willmcgugan

Copy link
Copy Markdown
Member

Thanks Tom. I couldn't quite manage a failing test myself. But this does seem to be the fix.

@willmcgugan willmcgugan merged commit de698bb into Textualize:main Nov 3, 2025
23 checks passed
@TomJGooding TomJGooding deleted the fix-text-area-fix-cursor-on-wrapped-line branch November 4, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor missing when clicking in Text Area

2 participants